{include file="public/head"}
<div class="main">
    {include file="public/left"}
    <div class="middle">
    {include file="public/header"}
    <div class='userinfo'>
        {include file="public/userleft"}
        <div class="pub_task">
            <h5>{:__('仲裁列表')}</h5>
            <ul class="layui-tab-title">
                <li data-target="-1" class="layui-this">{:__('全部')}</li>
                <li data-target="0">{:__('待处理')}</li>
                <li data-target="1">{:__('处理中')}</li>
                <li data-target="2">{:__('处理完')}</li>
            </ul>
            <ul class="task_table">
                <dl><span>{:__('状态')}</span><span>{:__('任务标题')}</span><span>{:__('仲裁说明')}</span><span>{:__('举报时间')}</span><span>{:__('联系方式')}</span><span>{:__('相关操作')}</span></dl>
            </ul>
        </div>
    </div>
    <div id="in_page" style="margin-left: 23%;"></div>
    {include file="public/foot"}
    </div>
    {include file="public/right"}
</div>
{include file="public/footer"}
<script>
    var status = '';
    noLog();

    var total = 0;
    function getarbitration(newpage,status)
    {
        if(status == -1){
            status = '';
        }
        $.ajax({
            url:'/api/mission/dissent',
            type:'get',
            data:{'token':token,'page':newpage,'limit':5,status:status},
            success:function(ret){
                if(ret.code == 1){
                    $("._list").remove();
                    if(ret['data'] == '' && ret['data'] == null && ret['data'] == undefined){
                        return fasle;
                    }
                    if(ret['data']['ls'] == '' && ret['data']['ls'] == null && ret['data']['ls'] == undefined){
                        return fasle;
                    }
                    var htl = "";
                    for(i in ret['data']['ls']){
                        var status = "";
                        var option = "";
                        
                        if(ret['data']['ls'][i]['status_txt'] == '' || ret['data']['ls'][i]['status_txt'] =='' || ret['data']['ls'][i]['status_txt'] == undefined){
                            ret['data']['ls'][i]['status_txt'] = '';
                        }
                        if(ret['data']['ls'][i]['mission_title'] == '' || ret['data']['ls'][i]['mission_title'] == '' || ret['data']['ls'][i]['mission_title'] == undefined){
                            ret['data']['ls'][i]['mission_title'] = '';
                        }
                        if(ret['data']['ls'][i]['remark'] == '' || ret['data']['ls'][i]['remark'] == '' || ret['data']['ls'][i]['remark'] == undefined){
                            ret['data']['ls'][i]['remark'] = '';
                        }
                        if(ret['data']['ls'][i]['userInfo'] == '' || ret['data']['ls'][i]['userInfo'] == '' || ret['data']['ls'][i]['userInfo'] == undefined){
                            ret['data']['ls'][i]['userInfo'] = {};
                            ret['data']['ls'][i]['userInfo']['email'] = '';
                        }
                        htl += '<dl class="_list">'
                            +'<span>'+ret['data']['ls'][i]['status_txt']+'</span>'
                            +'<span>'+ret['data']['ls'][i]['mission_title']+'</span>'
                            +'<span>'+ret['data']['ls'][i]['remark']+'</span>'
                            +'<span>'+ret['data']['ls'][i]['create_time']+'</span>'
                            +'<span>'+ret['data']['ls'][i]['userInfo']['email']+'</span>'
                            +'<span><a href="/'+ret['data']['ls'][i]['route']+'">{:__("查看")}</a></span>'
                            +'</dl>';
                    }
                    $(".task_table").append(htl);
                    total = ret['data']['total'];
                    if(newpage == 1){
                        pagechange();
                    }
                   
                } else if(ret.code != 401){
                    layer.msg(ret.msg,{icon:2});
                }
            }
        });
    }
    function pagechange()
    {
        //分页
        createpage('in_page',total,5,function(obj,first){
            var nowpage = obj.curr;
            if(!first){
                getarbitration(nowpage,status);
            }
        });
    }
    $(document).queue('task',function(){
        getarbitration(1,status);
    });
    $(document).dequeue('task');
    $(document).on("click",'.pub_task .layui-tab-title li',function(){
        var _this = $(this);
        status = _this.attr("data-target");
        getarbitration(1,status);
    });
</script>